//
//  Constant.h
//  Puzzle_Crazy
//
//  Created by Le Hung on 3/29/14.
//  Copyright (c) 2014 DanielLe. All rights reserved.
//

#define isVersion 0 //0 is free 1 is full

#define kColorBackGround [UIColor colorWithRed:185/255.0 green:209/255.0 blue:213/255.0 alpha:1]
#define kColorBlue [UIColor colorWithRed:89/255.0 green:151/255.0 blue:235/255.0 alpha:1]

#define IPAD     UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

#define kFramePuzzle    CGRectMake(10, 177, 300, 300)

// random
#define kRandom rand()%6

#define kPuzzleIP5 @"PuzzleViewController"
#define kPuzzleIP4 @"PuzzleViewController_IP4"

/* level */
typedef enum {
    levelEasy       = 3,
    levelMedium     = 4,
    levelHard       = 5
}levelPuzzle;
#define k1StarEasy      80
#define k2StarEasy      60
#define k3StarEasy      0
/* Database query */
#define kTableNameCategory      @"Category"
#define kTableNamePuzzle        @"Puzzle"
#define kId                     @"id"
#define kCategory               @"category"
#define kImageDB                @"image"
#define kEasyDB                 @"easy"
#define kMediumDB               @"medium"
#define kHardDB                 @"hard"
#define kshowDataDBPu           @"select * from Puzzle where id = %d"
#define kshowDataDBCa           @"select * from Category"
#define kinsertDataDB           @"insert into Puzzle values ('%@','%@','%@','%@')"
#define kupdateEasyDataDB       @"update Puzzle set easy='%@' where image='%@'"
#define kupdateMediumDataDB     @"update Puzzle set medium='%@' where image='%@'"
#define kupdateHardDataDB       @"update Puzzle set hard='%@' where image='%@'"
#define kupdateLevelDataDB      @"update Puzzle set easy='%@', medium='%@', hard='%@' where image='%@'"





